<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

	<ui:composition>
		<h:form>	
			<table cellpadding="0" cellspacing="1">
				<tr>
					<td id="search-bar">					
						<p:panel styleClass="search-panel"  header="#{msg['body.searchpanel.title']}">
						
							<table id="box-search" cellpadding="0" cellspacing="0">
								<tr>
									<td class="box-search-column"><h:outputText value="#{msg['body.searchpanel.ramo']}" />:</td>
									<td class="box-search-column">
										<h:selectOneMenu id="slc_ramo" styleClass="selectOneMenu" value="#{searchController.ramo.id}">
					               			<f:selectItems value="#{searchController.ramos}" var="ramo" itemLabel="#{ramo.nome}" itemValue="#{ramo.id}"/>
					               		</h:selectOneMenu>
									</td>
								</tr>
								<tr>
									<td class="box-search-column"><h:outputText  value="#{msg['body.searchpanel.estado']}" />:</td>
									<td class="box-search-column">
										<h:selectOneMenu id="slc_estado" value="#{searchController.estado}"  styleClass="selectOneMenu" converter="#{simpleEntityConverter}">		               		
					               			<f:selectItems value="#{searchController.estados}" var="estado" itemLabel="#{estado.nome}" itemValue="#{estado}" />
					               			<f:ajax listener="#{searchController.reloadMunicipios}" event="change" execute="@this" render="slc_municipio" />       		
					            		</h:selectOneMenu>
									</td>
								</tr>								
								<tr>
									<td class="box-search-column"><h:outputText value="#{msg['body.searchpanel.cidade']}" />:</td>
									<td class="box-search-column">
										<h:selectOneMenu id="slc_municipio" styleClass="selectOneMenu" value="#{searchController.municipio.id}">
					               			<f:selectItems value="#{searchController.municipios}" var="municipio" itemLabel="#{municipio.nome}" itemValue="#{municipio.id}" />
					               		</h:selectOneMenu>
									</td>
								</tr>
								<tr>
									<td id="box-search-button" colspan="2">									
										<p:commandButton value="#{msg['search.menu.button.buscar']}" action="#{searchController.searchMain}" ajax="false" image="search-button"></p:commandButton>
									</td>
								</tr>
							</table>													
						</p:panel>			
					</td>
					<td id="rigth-bar">					
						<table id="box-last-servicos" align="center" cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td>
									<b><h:outputText value="#{msg['body.lasservico.title']}" /></b>									
								</td>
							</tr>	
							<tr>
								<td><p:spacer height="3px"/></td>
							</tr>
							<tr>
								<td>
									<p:dataList value="#{searchController.servicos}" var="servico" 
										styleClass="search-bar-columns" itemType="disc">
										<p:column>
											<p:commandLink ajax="false" action="#{searchController.searchByServico}">												
						          				<f:setPropertyActionListener value="#{servico.id}" target="#{searchController.servico.id}" />
						          			  	<h:outputText value="#{servico.nome}" styleClass="menu-sub-value" />
						          			</p:commandLink><br/>	
										</p:column>										
									</p:dataList>
								</td>
							</tr>				
						</table>					
					</td>
				</tr>
			</table>
		</h:form>
	</ui:composition>
</html>